home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / •New Files / HexAndSuch Folder / MacsBug.txt < prev   
Text File  |  1999-12-28  |  4KB  |  85 lines

  1. This is no complete manual to MacsBug.  This is taken from a file I wrote a while
  2. back and is meant to be an extension of the file called "Hex and Such".
  3.  
  4.  
  5. --==< The Basics >==--
  6.  
  7.  
  8. You install MacsBug simply by throwing it into the System Folder, and by restarting
  9. your machine.  You activate it by pressing the “command” and “power-key” (the one
  10. towards the top of your keyboard marked with the head of an arrow pointing to the
  11. left) buttons.  This should have “dropped” you into MacsBug.  You will notice that
  12. you are in MacsBug because your desktop is replaced with a with a bunch of numbers on
  13. a white background.  
  14. Well, going from the top left side, under “SP” is the current position of the stack
  15. pointer, underneath the position of the SP are the values contained in the SP.  
  16. Under those numbers is the name of the application that is currently the foremost
  17. one.  
  18. Under that is the status of the Status Register, followed by the info held in the 8
  19. data registers, and the 8 address registers (or the 32 registers if it is a PPC
  20. program).  To the right of the registers is a horizontal line going across the
  21. screen.  
  22. Under that are about 4 lines of text.  The topmost line describes where in the
  23. application’s code the processor was halted.  Under that line are 3 other lines with
  24. assembly commands.  These are the three commands in line to be executed.  
  25. To the right of them (in the right bottom corner) are the hexadecimal values of the
  26. assembly commands.  
  27. Above this section (in the middle) is a large empty space.   This gets filled up with
  28. the results of the commands you give to MacsBug.  
  29. Your commands get written under the three assembly commands.  
  30.  
  31. What happens when you drop into MacsBug is that your processor stops executing
  32. commands, and you can for example go through a code step by step, command by command,
  33. following through exactly what the program does.  So how do you do that?
  34. Type “t” followed by a return.
  35. This causes the processor to execute the next assembly command in line.  The assembly
  36. command that was executed appears now in the middle blank section of your screen, and
  37. a new assembly command appears under the two old ones.
  38.  
  39.  
  40. --==< Basic MacsBug Commands >==--
  41.  
  42.    - t : traces over the next command in line.  If it is used on a JSR command it
  43. jumps over the the subroutine.  (It executes the whole subroutine, without allowing
  44. you to see what happened)
  45.  
  46.    - s : does the same thing as “t” except it “steps into” a subroutine.  For example
  47. if you are not interested in what happens in an subroutine you should type “t”.  This
  48. causes the processor to continue until it reaches a RTS command, and only then give
  49. the control back to you.  If you on the other hand want to see what happens in that
  50. subroutine, you should type “s” to step into it and follow through the code from
  51. there.
  52.  
  53.    - es : this forces the current application to quit (not always).  
  54.    
  55.    - rs :  restarts your computer (sometimes it doesn't work and you have to do it
  56. the old fashioned way: apple-control-powerkey)
  57.  
  58.    - rb :  reboots your computer (boots up the different external devices at
  59. startup).  This is slower then the “rb” command
  60.  
  61.    - dm [address] : displays what is in the memory at a given address.  For example,
  62. the command “dm a6” shows you what is held in the address pointed to by address
  63. register 6.  If you type “dm abcd”  it shows you what is held in the memory at
  64. location “abcd” (in hex that is).
  65.  
  66.    - db [address] : displays byte from address
  67.  
  68.    - dw [address] : displays word from address
  69.  
  70.    - dl [address] : displays long from address
  71.  
  72.    - il : dissembles the codes.  Used if you, for example, want to see what happens
  73. after a branch code.
  74.  
  75.    - atb [a-trap name] : MacsBug activates every time that a-trap is being called.
  76.  
  77.    - atc : clears a-traps
  78.  
  79.    - f address expr ‘string’ : this is the find command.  “address” refers to the
  80. starting point of the search; “expr” is how many bytes it should search; “ ’string' ”
  81. is what you’re looking for!  Observe the semi quotation mark before the string!  You
  82. need to use that!
  83.  
  84. You can find out more about commands for MacsBug by typing “help”
  85.